/*1、 没做持久化处理 */
/* import { createStore, combineReducers } from 'redux'
import { CollApsedReducer } from './reducers/CollapsedReducer'
import { LoadingReducer } from './reducers/LoadingReducer'
const reducer = combineReducers({
  CollApsedReducer,
  LoadingReducer
})
const store = createStore(reducer);

export default store */

/*
 store.dispatch()

 store.subsribe()

*/
/*2、 做持久化处理 */
import { createStore, combineReducers } from 'redux'
import { CollApsedReducer } from './reducers/CollapsedReducer'
import { LoadingReducer } from './reducers/LoadingReducer'

import { persistStore, persistReducer } from 'redux-persist'
import storage from 'redux-persist/lib/storage' // defaults to localStorage for web

const persistConfig = {
  key: 'xiantao',
  storage,

  //配置黑名单：LoadingReducer这个 reducer不做持久化处理
  blacklist: ['LoadingReducer'],
}
const reducer = combineReducers({
  CollApsedReducer,
  LoadingReducer,
})
const persistedReducer = persistReducer(persistConfig, reducer)

const store = createStore(persistedReducer)
const persistor = persistStore(store)

export { store, persistor }

/*
 store.dispatch()

 store.subsribe()

*/
